package com.itheima.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import com.itheima.constant.MessageConst;
import com.itheima.entity.PageResult;
import com.itheima.entity.QueryPageBean;
import com.itheima.entity.Result;
import com.itheima.pojo.Role;
import com.itheima.service.RolenameService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user_role")
@Slf4j
public class RolenameController {
    @Reference
    RolenameService rolenameService;


    @RequestMapping("/findAll")
    public Result findAll(){
        log.debug("Rolename:findAll+++++++++++++++++++++++++++++++++++");
        List<Role> roleList = rolenameService.findAll();
        log.debug("角色查询所有成功!!");
        return new Result(true, "角色查询成功", roleList);
    }

}
